function getOption(){
    var optval = document.getElementById('selCom').value;
   
    if(optval=="comune"){
        document.getElementById('scelta').innerHTML = comune();
    }else if(optval=="cod_com"){
    	document.getElementById('scelta').innerHTML = cod_comune();
    }else {
        alert("SELEZIONA UN TIPO DI SCELTA");
    }
   
}

function comune(){
   
    var c = "<select onchange=\"newMap()\" name=\"selCom2\" id=\"selCom2\">" +
            " <option value=\"empty\">Seleziona un opzione</option>" +
            " <option value=\"trento\">Trento</option>" +
            " <option value=\"ala\">Ala</option>" + 
            " <option value=\"albiano\">Albiano</option>" + 
            " <option value=\"albiano\">Albiano</option>" +
            " <option value=\"aldeno\">Aldeno</option>" +
            " <option value=\"amblar\">Amblar</option>" +
            " <option value=\"andalo\">Andalo</option>" +
            " <option value=\"arco\">Arco</option>" +
            " <option value=\"avio\">Avio</option>" +
            " <option value=\"bedollo\">Bedollo</option>" +
            " <option value=\"bersone\">Bersone</option>" +
            " <option value=\"besenello\">Besenello</option>" +
            " <option value=\"bosentino\">Bosentino</option>" + 
            " <option value=\"bleno\">Bleno</option>" + 
            " <option value=\"bleggioSuperiore\">Bleggio Superiore</option>" + 
            " <option value=\"bocenago\">Bocenago</option>" +
            " <option value=\"bolbeno\">Bolbeno</option>" +
           /* " <option value=\"amblar\">Amblar</option>" +
            " <option value=\"andalo\">Andalo</option>" +
            " <option value=\"arco\">Arco</option>" +
            " <option value=\"avio\">Avio</option>" +
            " <option value=\"bedollo\">Bedollo</option>" +
            " <option value=\"bersone\">Bersone</option>" +
            " <option value=\"trento\">Trento</option>" +
            " <option value=\"ala\">Ala</option>" + 
            " <option value=\"albiano\">Albiano</option>" + 
            " <option value=\"albiano\">Albiano</option>" +
            " <option value=\"aldeno\">Aldeno</option>" +
            " <option value=\"amblar\">Amblar</option>" +
            " <option value=\"andalo\">Andalo</option>" +
            " <option value=\"arco\">Arco</option>" +
            " <option value=\"avio\">Avio</option>" +
            " <option value=\"bedollo\">Bedollo</option>" +
            " <option value=\"bersone\">Bersone</option>" +
            */
           
            " <option value=\"dro\">Dro</option>" +
            " <option value=\"brentonico\">Brentonico</option> </select>";
    return c;
}

function cod_comune(){
	   
    var c = "<select onchange=\"newMap()\" name=\"selCom2\" id=\"selCom2\">" +
            " <option value=\"empty\">Seleziona un opzione</option>" +
            " <option value=\"E1FW\">E1</option>" +
            " <option value=\"E1AA\">E1AA</option>" +
            " <option value=\"E1FH\">E1FH</option> </select>";
    return c;
}


function newMap(){
    var op = document.getElementById('selCom2').value;
    var op2 = document.getElementById('selCom').value;
 
    document.location.href='rs?op='+op+'&op2='+op2;
}

function checkMod(){
	var path = document.location.href;
	//alert(path);
	var pos = path.indexOf("mod");
	if(pos!=-1){
		path = path.slice(pos);
	    //alert(pos);
	    var pathArr = path.split("mod=");
	    if(pathArr[1]=="no"){
	    	alert("Non sono state rilevate modifiche nel comune selezionato");
	    }
	}
    
	
}